#include "header.h"
#include "logger.h"
#include "echoserver.hpp"
#include "readconfig.hpp"
#include <iostream>
int main()
{
#if 1
    LOG_INFO("main");
    moqi::ReadConfig *up = moqi::ReadConfig::getInstance();
    up->read("./server.config");
    string ip = up->get("ip");
    string port  = up->get("port");
    string threadnum = up->get("threadnum");
    string taskquesize = up->get("taskquesize");
    LOG_INFO("ip = "+ ip);
    LOG_INFO("port = "+ port);
    LOG_INFO("threadnum = "+ threadnum);
    LOG_INFO("taskquesize = "+ taskquesize);
    moqi:: EchoServer server(ip,stoi(port), stoi(threadnum), stoi(taskquesize));

#endif


    //moqi:: EchoServer server("127.0.0.1", 8080, 4 ,10);
    server.start();
    return 0;
}
